package model

import (
	"time"
)

// 用户表

type User struct {
	Id            int       `gorm:"column:id;primary_key" db:"id" json:"id" form:"id"`                                                    //用户的id
	Name          string    `gorm:"column:name" db:"name" json:"name" form:"name" binding:"required"`                                     //用户的昵称
	Account       int       `gorm:"column:account" db:"account" json:"account" form:"account" binding:"required"`                         //用户登录账号
	Password      string    `gorm:"column:password" db:"password" json:"-" form:"password" binding:"required"`                            //用户密码
	Avatar        string    `gorm:"column:avatar" db:"avatar" json:"avatar" form:"avatar" binding:"required"`                             //头像
	Sex           int8      `gorm:"column:sex" db:"sex" json:"sex" form:"sex" binding:"required"`                                         //性别: 1男 ; 2女
	Individuality string    `gorm:"column:individuality" db:"individuality" json:"individuality" form:"individuality" binding:"required"` //个性签名
	CreateTime    time.Time `gorm:"column:create_time" db:"create_time" json:"create_time" form:"create_time"`                            //账号创建时间
}

func (u *User) TableName() string {
	return "user"
}
